<?php
use yii\helpers\ArrayHelper;
use app\common\helper\CommonHelper;
$arr_pic = \yii\helpers\Json::decode($product['img'],true);
$pic = ArrayHelper::getValue($arr_pic,'0');
$pic = CommonHelper::getMarketPlacePic($pic);
$arn = CommonHelper::float($product['price'] * $product['creator_commission_percent'] /100);
$creator_commission_percent = CommonHelper::float($product['creator_commission_percent']);
$price = CommonHelper::float($product['price']);
$product_sales = CommonHelper::toK($product['product_sales']);
?>
<table class="es-left" cellspacing="0" cellpadding="0" align="left" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:left">
    <tbody><tr style="border-collapse:collapse">
        <td class="es-m-p0r es-m-p20b" align="center" style="padding:0;Margin:0;">
            <table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
                <tbody><tr style="border-collapse:collapse">
                    <td align="center" style="padding:0;Margin:0;font-size:0">
                        <a target="_blank" href="<?=$product['link']?>" style="-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;font-size:16px;text-decoration:underline;color:#BF9000">
                            <img class="adapt-img" src="<?=$pic?>" alt="Lamp sphere" title="Lamp sphere" style="display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic" width="109">
                        </a>
                    </td>
                </tr>
                <tr style="border-collapse:collapse">
                    <td class="es-m-txt-c" align="center" style="padding:0;Margin:0;padding-bottom:10px;padding-top:15px"><p style="overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;width:200px;height:46px;Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-size:16px;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:24px;color:#333333"><span class="product-name"><?=$product['name']?></span><br></p></td>
                </tr>
                <tr style="border-collapse:collapse">
                    <td align="center" style="padding:0;Margin:0;padding-bottom:5px"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-size:16px;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:24px;color: red;"> $<?=$arn?> Earn per sale</p></td>
                </tr>
                <tr style="border-collapse:collapse">
                    <td bgcolor="#d9ead3" align="center" style="padding:0;Margin:0;padding-top:5px;padding-bottom:5px"><h3 style="Margin:0;line-height:24px;mso-line-height-rule:exactly;font-family:helvetica, 'helvetica neue', arial, verdana, sans-serif;font-size:20px;font-style:normal;font-weight:normal;color:#333333">
                            <?=floatval($product['creator_commission_percent'])?>%
                            <span  style="color: rgba(252, 70, 3, 1);margin-left: 5px;">
                                <?=$product_sales?> Sold
                            </span>
                        </h3></td>
                </tr>
                <tr style="border-collapse:collapse">
                    <td align="center" style="padding:0;Margin:0;padding-top:10px">
                        <a href="<?=$product['link']?>" style="text-underline: none;">
                            <div style="width: 148px;">
                                <div style="line-height:30px;font-size: 12px;    border-radius: 9999px;    cursor: pointer;    position: relative;">
                                    <div style="color: #fff;    text-align: center !important;font-weight: 500;    --tw-bg-opacity: 1;background-color: #000;    border-radius: 9999px;    justify-content: center;">
                                        Get Free Sample
                                    </div>
                                </div>
                            </div>
                        </a>
                    </td>
                </tr>
                </tbody></table></td>

    </tr>
    </tbody></table><!--[if mso]></td><td style="width:173px" valign="top"><![endif]-->

